{% extends "vueAdmin/base_site.html" %}
{% load i18n static vueAdmin_urls vueAdmin_modify %}

{# site stylesheet section #}
{% block extrastyle %}
  {{ block.super }}
  <link rel="stylesheet" type="text/css" href="{% static "vueAdmin/css/pages/changelist.css" %}">
{% endblock %}
{# site stylesheet section #}

{# site javascript section #}
{% block javascript %}
  {{ block.super }}
  <script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{% endblock %}
{# site javascript section #}

{# addtional extra stylesheet or javascript #}
{% block extrahead %}
  {{ block.super }}
  {{ media }}
  <script type="text/javascript" id="django-admin-form-add-constants" src="{% static 'admin/js/change_form.js' %}"
    {% if adminform and add %}
      data-model-name="{{ opts.model_name }}"
    {% endif %}>
  </script>
  {# JavaScript for prepopulated fields #}
  {% prepopulated_fields_js %}
{% endblock %}
{# addtional extra stylesheet or javascript #}

{% block content %}
  <div class="vue-content-header">
    <a-breadcrumb style="font-size: 1.2em;">
      <a-breadcrumb-item>{{ opts.app_config.verbose_name }}</a-breadcrumb-item>
      <a-breadcrumb-item>{{ opts.verbose_name_plural|capfirst }}</a-breadcrumb-item>
      <a-breadcrumb-item>{{ title }}</a-breadcrumb-item>
    </a-breadcrumb>

    <div class="object-tools">
      {% block object-tools %}
        <a-button-group size="small">
          {% block object-tools-items %}
            {% change_form_object_tools %}
          {% endblock %}
        </a-button-group>
      {% endblock %}
    </div>
  </div>

  <div id="content-main">
    <a-form {% if has_file_field %}enctype="multipart/form-data"{% endif %} action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form">
      {% csrf_token %}
      {% block form_top %}{% endblock %}
      <div>
        {% if is_popup %}
          <input type="hidden" name="{{ is_popup_var }}" value="1">
        {% endif %}
        {% if to_field %}
          <input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">
        {% endif %}

        {% if errors %}
          <a-alert type="error" closable
            message="
              {% if errors|length == 1 %}
                {% trans "Please correct the error below." %}
              {% else %}
                {% trans "Please correct the errors below." %}
              {% endif %}
            "
          >
          </a-alert>
          {{ adminform.form.non_field_errors }}
        {% endif %}

        {% block field_sets %}
          {% for fieldset in adminform %}
            {% include "vueAdmin/includes/fieldset.html" %}
          {% endfor %}
        {% endblock %}

        {% block after_field_sets %}{% endblock %}

        {% block inline_field_sets %}
          {% for inline_admin_formset in inline_admin_formsets %}
            {% include inline_admin_formset.opts.template %}
          {% endfor %}
        {% endblock %}

        {% block after_related_objects %}{% endblock %}

        {% block submit_buttons_bottom %}
          {% submit_row %}
        {% endblock %}

        {% block admin_change_form_document_ready %}{% endblock %}
      </div>
    </a-form>
  </div>
{% endblock %}

{% block scripts %}
  <script type="text/javascript">
    window.mixins = {};
  </script>
  {{ block.super }}
{% endblock %}